from selenium import webdriver
# from lxml import etree
# from time import sleep  #设置睡眠时间
# 实倒化一个浏发器对象-（传入测览器的驱动成)
bro = webdriver.Chrome()
# 让浏览器发起一个指定url对应请求
bro.get('https://www.jd.com/?cu=true&utm_source=gou.lhticket.com&utm_medium=tuiguang&utm_campaign=t_1001478697_&utm_term=09a257a4d46c42048161cbb2fd414285')
# #page_source 获取浏览器当前页面的页面源码数据
# page_text = bro.page_source
# # 解析企业名称
# tree = etree. HTML (page_text)
# li_list = tree.xpath('//ul[@id="azlist"]/li')
# for li in li_list:
#     name = li_list.xpath('./dl/@title')[0]
#     print (name)
# sleep(5)
# bro.quit()
#
# # 标签定位   定位淘宝框搜索输入
# search_input =bro.find_elements_by_id('q')
# #标签交互    在搜索框输入iPhone
# search_input.send_key('iphone')
# #点击搜索按钮
# btn=bro.find_element_by_css_selector('.btn-search')
# btn.click()
